9、ORB_SLAM2_Octomap9.1 Introduction9.2. Use9.3、octomap_server9.3.1. Topics and services9.3.2. Configuration parameters9.3.3.TF transformation
octomap official website:http://octomap.github.io/
octomap source code:https://github.com/OctoMap/octomap
octomap wiki:http://wiki.ros.org/octomap
octomap_server:http://wiki.ros.org/octomap_server
Octomap uses the octree data structure to store the probabilistic occupancy map of the three-dimensional environment. OctoMap library implements a 3D occupancy grid mapping method, providing data structures and mapping algorithms in C++, which is particularly suitable for robots. The map implementation is based on octree.
It elegantly compresses and updates maps with adjustable resolution! It stores maps in the form of octotree (will be discussed later), which can save a lot of space compared to point clouds. The map created by octomap probably looks like this: (different resolutions from left to right)
Note: When building a map, moving the robot slowly and losing key frames may cause the map building to fail.
According to different models, you only need to set the purchased model in [.bashrc], X1 (normal four-wheel drive) X3 (Mailun) Take X3 as an example
Open the [.bashrc] file
sudo vim .bashrc
Find the [ROBOT_TYPE] parameters and modify the corresponding car model
xxxxxxxxxx
export ROBOT_TYPE=X3 # ROBOT_TYPE: X1 X3 X3plus R2 X7
Start orb_slam and the underlying driver (Robot side)
xxxxxxxxxx
roslaunch yahboomcar_slam robot_orb_slam.launch bUseViewer:=true
Start octree mapping (Robot side)
xxxxxxxxxx
roslaunch yahboomcar_slam robot_orb_octomap.launch frame_id:=odom use_rviz:=false
Turn on the visual interface (virtual machine side)
xxxxxxxxxx
roslaunch yahboomcar_slam view_orb_octomap.launch
Due to the octree, its map looks like it is composed of many small squares (much like Minecraft). When the resolution is high, the squares are small; when the resolution is low, the squares are large. Each square represents the probability of that square being occupied.
Subscribe to topics | type | description |
---|---|---|
cloud_in | sensor_msgs/PointCloud2 | Incoming 3D point cloud for scan integration. |
Post a topic | type | description |
octomap_binary | octomap_msgs/Octomap | The complete maximum likelihood occupancy map is a compact octal-mapped binary stream encoding free space and occupied space. Binary messages only differentiate between free space and occupied space, but smaller. |
octomap_full | octomap_msgs/Octomap | The complete maximum likelihood occupancy map is a compact octal-mapped binary stream encoding free space and occupied space. The complete message contains the complete probabilities and all additional data stored in the tree. |
occupied_cells_vis_array | visualization_msgs/MarkerArray | In RViz, all occupied voxels are marked as visual "boxes" |
octomap_point_cloud_centers | sensor_msgs/PointCloud2 | The center of all occupied voxels serves as a point cloud and is useful for visualization. Note that this will have gaps because points have no volume size and octagonal voxels can have different resolutions! |
map | nav_msgs/OccupancyGrid | Project the 2D occupation map downward from the 3D map. |
Service | type | description |
octomap_binary | octomap_msgs/GetOctomap | The complete maximum likelihood occupancy map is a compact octal-mapped binary stream encoding free space and occupied space. |
clear_bbx | octomap_msgs/BoundingBoxQuery | Clears an area in the 3D occupancy map, setting all voxels in that area to "Free" |
reset | std_srvs/Empty | Reset the entire map |
Node view
xxxxxxxxxx
rqt_graph
parameters | type | default | description |
---|---|---|---|
frame_id | string | /map | The static global frame in which the map will be published. When building a map dynamically, sensor data needs to be converted to this frame. |
resolution | float | 0.05 | The resolution of the map in meters when starting with an empty map. Otherwise the resolution of the loaded file will be used. |
base_frame_id | string | base_footprint | Robot base that performs ground plane detection (if enabled) |
height_map | bool | true | Whether the visualization should encode the height with different colors |
color/[r/g/b/a] | float | When ~heigh_map=False, display the color of occupied cells in the range [0:1] | |
sensor_model/max_range | float | -1 (unlimited) | The maximum extent (in meters) to interpolate point cloud data when building a map dynamically. Limiting the range to a useful range (e.g. 5 meters) prevents false error points away from the robot. |
sensor_model/[hit|miss] | float | 0.7 / 0.4 | Hit and miss probabilities in sensor models when building maps dynamically |
sensor_model/[min|max] | float | 0.12 / 0.97 | Minimum and maximum probabilities of clamping when building a map dynamically |
latch | bool | True for static mapping, false if no initial mapping is given | Whether the topic is locked for publishing or published only once per change. For best performance when building maps (which update frequently), set this to false. When set to true, all topics and visualizations will be created on all changes on each map. |
filter_ground | bool | false | Whether the ground plane should be detected and ignored from scan data when building a map dynamically using pcl::SACMODEL_vertical_plane. This clears everything on the ground, but does not insert the ground into the map as an obstacle. If this feature is enabled, the ~ground_filter/... parameters can be further configured. |
ground_filter/distance | float | 0.04 | The distance threshold of the point to be segmented to the ground plane (z direction) |
ground_filter/angle | float | 0.15 | The angle threshold between the detected plane and the horizontal plane detected as the ground |
ground_filter/plane_distance | float | 0.07 | For a plane to be detected as ground, the distance threshold from z=0 (the fourth coefficient of the PCL plane equation) |
pointcloud[min|max]z | float | -/+ infinity | Insert in the callback the minimum and maximum height to be considered. |
occupancy[min|max]z | float | -/+ infinity | Minimum and maximum height to consider in the final map. |
Required TF transformation | description |
---|---|
sensor data frame --> /map | If you do scan integration, you need to convert the sensor data into a global map frame. This information needs to be obtained from external SLAM or localization nodes. |
View tf tree
xxxxxxxxxx
rosrun rqt_tf_tree rqt_tf_tree